package com.wingsfrog.travel.modules.entity;

import javax.persistence.*;
import java.sql.Timestamp;

/**
 * Created by rankin on 16/3/30.
 */
@Entity
@Table(name = "t_main_task", schema = "", catalog = "travel")
public class MainTask {
    private int id;
    private String mainTaskName;
    private String description;
    private Timestamp expireTime;
    private int minCount;
    private int type;
    private Timestamp createdAt;
    private Timestamp updatedAt;
    private String createBy;
    private String updateBy;
    private Integer mode;
    private String area;
    @Id
    @Column(name = "id")
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    @Column(name = "area")
    public String getArea() {
        return area;
    }

    public void setArea(String area) {
        this.area = area;
    }

    @Column(name = "mode")
    public Integer getMode() {
        return mode;
    }

    public void setMode(Integer mode) {
        this.mode = mode;
    }

    @Basic
    @Column(name = "type",length = 3)
    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }

    @Basic
    @Column(name = "main_task_name")
    public String getMainTaskName() {
        return mainTaskName;
    }

    public void setMainTaskName(String mainTaskName) {
        this.mainTaskName = mainTaskName;
    }

    @Basic
    @Column(name = "description")
    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    @Basic
    @Column(name = "expire_time")
    public Timestamp getExpireTime() {
        return expireTime;
    }

    public void setExpireTime(Timestamp expireTime) {
        this.expireTime = expireTime;
    }

    @Basic
    @Column(name = "min_count")
    public int getMinCount() {
        return minCount;
    }

    public void setMinCount(int minCount) {
        this.minCount = minCount;
    }

    @Basic
    @Column(name = "created_at")
    public Timestamp getCreatedAt() {
        return createdAt;
    }

    public void setCreatedAt(Timestamp createdAt) {
        this.createdAt = createdAt;
    }

    @Basic
    @Column(name = "updated_at")
    public Timestamp getUpdatedAt() {
        return updatedAt;
    }

    public void setUpdatedAt(Timestamp updatedAt) {
        this.updatedAt = updatedAt;
    }

    @Basic
    @Column(name = "create_by")
    public String getCreateBy() {
        return createBy;
    }

    public void setCreateBy(String createBy) {
        this.createBy = createBy;
    }

    @Basic
    @Column(name = "update_by")
    public String getUpdateBy() {
        return updateBy;
    }

    public void setUpdateBy(String updateBy) {
        this.updateBy = updateBy;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        MainTask mainTask = (MainTask) o;

        if (id != mainTask.id) return false;
        if (minCount != mainTask.minCount) return false;
        if (mainTaskName != null ? !mainTaskName.equals(mainTask.mainTaskName) : mainTask.mainTaskName != null)
            return false;
        if (description != null ? !description.equals(mainTask.description) : mainTask.description != null)
            return false;
        if (expireTime != null ? !expireTime.equals(mainTask.expireTime) : mainTask.expireTime != null) return false;
        if (createdAt != null ? !createdAt.equals(mainTask.createdAt) : mainTask.createdAt != null) return false;
        if (updatedAt != null ? !updatedAt.equals(mainTask.updatedAt) : mainTask.updatedAt != null) return false;
        if (createBy != null ? !createBy.equals(mainTask.createBy) : mainTask.createBy != null) return false;
        if (updateBy != null ? !updateBy.equals(mainTask.updateBy) : mainTask.updateBy != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = id;
        result = 31 * result + (mainTaskName != null ? mainTaskName.hashCode() : 0);
        result = 31 * result + (description != null ? description.hashCode() : 0);
        result = 31 * result + (expireTime != null ? expireTime.hashCode() : 0);
        result = 31 * result + minCount;
        result = 31 * result + (createdAt != null ? createdAt.hashCode() : 0);
        result = 31 * result + (updatedAt != null ? updatedAt.hashCode() : 0);
        result = 31 * result + (createBy != null ? createBy.hashCode() : 0);
        result = 31 * result + (updateBy != null ? updateBy.hashCode() : 0);
        return result;
    }
}
